﻿using System;
using System.Security.Principal;
using NUnit.Framework;
using RenewalProjects.Libraries.Common.Testing.Attributes;

namespace RenewalProjects.Libraries.Common.Testing.Tests.Fixtures
{
	[TestFixture]
	public class UserAdministratorPriveledgesRequiredAttributeFixture
	{
		[Test]
		[UserAdministratorPrivilegesRequiredAttribute]
		public void Test_requiring_admin_rights()
		{
			bool isAdmin = new WindowsPrincipal(WindowsIdentity.GetCurrent())
			    .IsInRole(WindowsBuiltInRole.Administrator);

			if(!isAdmin)
			{
				Assert.Fail("Shouldn't hit this point. Must be inconclusive.");
			}
		}
	}
}